Many spreadsheet programs provide a macro language which allows users to develop macros for their individual use. Two types of macros are generally available within spreadsheet programs. First, "command macros" are available to perform particular tasks. Command macros are series of instructions which are equivalent to commands that are executed in response to user actions, such as a keystroke, mouse action or pointing device action. The instructions are stored in a structure known as a macro sheet. The instructions on the macro sheet are then interpreted when the user desires to execute the command macro. Second, "function macros" are available to allow the user to create custom functions. Function macros differ from command macros in that function macros return a value, rather than merely performing actions like command macros. Moreover, function macros cannot change variables that change the state of the spreadsheet program, whereas commands have such a capability.
Macros have proven useful but do not have an extensive enough range of capabilities to fully meet the demands of spreadsheet program users. In particular, users have demanded that they be able to call tasks outside of the spreadsheet program. An example of such a task is a system call to open an external file. In response to user demands, many spreadsheet programs have been modified to provide dynamic-link library (DLL) modules that perform the desired external tasks, like system calls. The addition of DLLs has greatly enhanced the range of functions available to the spreadsheet program user. Unfortunately, the DLLs cannot callback into the spreadsheet program to perform spreadsheet program commands or functions.
One attempt to overcome this limitation has been to incorporate the code for executing a spreadsheet command or function directly into a DLL. Including the added code in the DLL, however, is quite cumbersome and often requires redundant duplication of command and function code across multiple DLLs. Furthermore, the inclusion of this added code to the DLL does not provide a capability to callback into the spreadsheet program.